Mac下Sublime Text3 Python开发环境的配置
Mac 下查看Python路径的方法:
1.terminal :
which python
2.terminal:
python - import sys - print sys.path
设置Sublime Text的语法:
View - syntax - python
设置默认编译环境(默认版本2.7)
Tools - Build System - Python
添加Python3.5编译环境(如果需要)
Tools - Butld System - New Build System
在打开的文件中贴上以下代码:其中:cmd 后面为你的Python路径:
12345{"cmd": ["/Library/Frameworks/Python.framework/Versions/3.5/bin/python3", "-u", "$file"],"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)","selector": "source.python"}
测试并编译
print ('hello world')
然后
command + s
保存command + B
编译,下面有输出结果即为成功。